package com.jjb.www.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.hjq.shape.view.ShapeButton;
import com.hjq.shape.view.ShapeTextView;
import com.jjb.www.R;
import com.jjb.www.app.AppActivity;
import com.jjb.www.manager.ActivityManager;
/**
 *    author : Android CRG
 *    time   : 2018/10/18
 *    desc   : 答题结束页面
 */
public class ExamResultsActivity extends AppActivity {

    private ShapeTextView mTvName;
    private ShapeTextView mTvTime;
    private ShapeTextView mTvNumber;
    private ShapeButton mBtnDetitls;
    private ShapeButton mBtnMain;



    @Override
    protected int getLayoutId() {
        return R.layout.activity_exam_results;
    }

    @Override
    protected void initView() {
        mTvName = findViewById(R.id.tv_name);
        mTvTime = findViewById(R.id.tv_time);
        mTvNumber = findViewById(R.id.tv_number);
        mBtnDetitls = findViewById(R.id.btn_detitls);
        mBtnMain = findViewById(R.id.btn_main);
        setOnClickListener(mBtnDetitls,mBtnMain);
    }

    @Override
    protected void initData() {
        setTitle(getString("exam_type_name"));
        mTvName.setText(getString("sentry_name"));
        mTvTime.setText("(用时"+getString("exam_time")+")");
        mTvNumber.setText(getString("score"));
    }

    @Override
    public void onClick(View view) {
        if (view==mBtnDetitls){
            Intent intent = new Intent();
            intent.putExtra("id",getString("paper_id"));
            intent.setClass(getContext(),AnsweringDetailsActivity.class);
            startActivity(intent);
            finish();
        }else if (view==mBtnMain){
            startActivity(HomeActivity.class);
            ActivityManager.getInstance().finishAllActivities(HomeActivity.class);
        }
    }
}